package com.rjxy.plansystemmanagement.service.impl;

import com.rjxy.plansystemmanagement.entity.HotelInformation;
import com.rjxy.plansystemmanagement.mapper.HotelMapper;
import com.rjxy.plansystemmanagement.service.HotelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HotelServiceImpl implements HotelService {
    @Autowired
    private HotelMapper hotelMapper;

    /**
     * 获取所有酒店
     * @return
     */
    @Override
    public List<HotelInformation> list() {
        return hotelMapper.list();
    }

    /**
     * 根据id删除指定酒店
     * @param ID
     */
    @Override
    public void deleteHotel(Integer ID) {
        hotelMapper.deleteHotel(ID);
    }

    /**
     * 插入酒店信息
     * @param hotelInformation
     */
    @Override
    public void addHotel(HotelInformation hotelInformation) {
        hotelMapper.addHotel(hotelInformation);
    }

    @Override
    public HotelInformation getHotelById(Integer ID) {
        return hotelMapper.getHotelById(ID);
    }

    @Override
    public List<HotelInformation> getHotelByAddress(String hotelAddress) {
        return hotelMapper.getHotelByAddress(hotelAddress);
    }

    @Override
    public List<HotelInformation> getHotelByStar(String hotelStar) {
        return hotelMapper.getHotelByStar(hotelStar);
    }

    @Override
    public HotelInformation getHotelByName(String hotelName) {
        return hotelMapper.getHotelByName(hotelName);
    }

    @Override
    public void updateHotel(HotelInformation hotelInformation) {
        hotelMapper.updateHotel(hotelInformation);
    }

    @Override
    public List<HotelInformation> getHotelByTheme(String hotelTheme) {
        return hotelMapper.getHotelByTheme(hotelTheme);
    }

    @Override
    public List<HotelInformation> getHotelByFacilities(String hotelFacilities) {
        return hotelMapper.getHotelByFacilities(hotelFacilities);
    }

    @Override
    public List<HotelInformation> searchHotels(String hotelAddress, String hotelStar, String hotelTheme, String hotelFacilities) {
        return hotelMapper.searchHotels(hotelAddress,hotelStar,hotelTheme,hotelFacilities);
    }
}
